package com.epfly.iface.promo.activity.enums;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * 客户群体:0.不限;1.散户;2.会员;3.员工
 */
public enum ActivityObjectTypeEnum {


    UN_LIMIT((byte)0, "不限"), CONSUMER((byte)1, "散户"), MEMBER((byte)2, "会员"), EMPLOYEE((byte)2, "员工"),

    ;



    public static final Map<Byte, ActivityObjectTypeEnum> loopUp = new HashMap<>();

    static {
        for (ActivityObjectTypeEnum value : values()) {
            loopUp.put(value.getKey(), value);
        }
    }

    public static String getValue(Collection<Byte> keyList) {
        return keyList.stream().map(e -> loopUp.get(e).getValue()).collect(Collectors.joining("、"));
    }


    private ActivityObjectTypeEnum(Byte key, String value) {
        this.key = key;
        this.value = value;
    }


    private Byte key;

    private String value;


    public Byte getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }
}
